<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
    <title>简体中文转繁体</title>
</head>
<body>
简体：<input type="text" id="jianti">
<input type="button" id="submit" value="转换"><br>
繁体：<input type="text" id="fanti">
<input type="button" id="clear" value="重置"><br>


</body>
<script src="https://code.jquery.com/jquery-3.0.0.min.js" type="text/javascript"></script>
<script>
    $('#submit').on('click',function () {
        var jianti = $('#jianti').val();
        if(jianti == '' || jianti == null){
            alert('文本框不能为空！');
            return false;
        }
        $.ajax({
           type:"POST",
           url:"conversion.php",
           data:{"jianti":jianti},
           success:function (data) {
               $('#fanti').val(data);
           }
        });
    })
    
    $('#clear').on('click',function () {
        $('#jianti').val('');
        $('#fanti').val('');
    })
</script>
</html>